package com.stars.services.impl.system;
import com.github.pagehelper.PageInfo;
import com.stars.entity.system.SystemPerUserEntity;
import com.stars.services.system.SystemPerUserAccessServices;
import com.stars.dao.mapper.system.SystemPerUserMapper;
import com.stars.entity.dto.system.SystemPerUserDTO;

import java.util.List;
import com.stars.entity.ListPage;
import com.github.pagehelper.PageHelper;
import com.stars.services.impl.BaseAccessServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Title: 资源与用户关系 业务逻辑
 * @author dj
 * @date 2019-10-17 20:57:38
 * @version V1.0
 *
 */
@Service
public class SystemPerUserAccessServicesImpl  extends BaseAccessServiceImpl<SystemPerUserMapper , SystemPerUserEntity> implements  SystemPerUserAccessServices {
    @Autowired
    private SystemPerUserMapper  systemPerUserMapper;


    /**
     * 分页查询
     * @param pageNum 查询参数 起始页，大小。
     * @return
     */
    @Override
    public PageInfo<SystemPerUserDTO> pageList(Integer pageNum, Integer pageSize, SystemPerUserDTO dto) throws Exception{
        ListPage<SystemPerUserDTO> listPage = new ListPage<>(pageNum, pageSize, dto);
        PageHelper.startPage(pageNum, pageSize);
        List<SystemPerUserDTO> list = systemPerUserMapper.pageQuerySystemPerUser(listPage);
        PageInfo<SystemPerUserDTO> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
